<?php if(!IS_AJAX){?>

<include file="Public:header" />
<div class="row">
  <div class="col-sm-7 col-md-8 col-lg-9">
    <div class="directory-info-row" style="margin-top:0;">
      <section class="panel">
        <header class="panel-heading custom-tab ">
          <ul class="nav nav-tabs">
            <li class="active"> <a href="#home" data-toggle="tab">通讯录</a> </li>
          </ul>
        </header>
        <style>
			.panel-card{border:1px solid #ddd; background:#fafafa;}
			.panel-card:hover{ background:white;}
		</style>
        <div class="panel-body">
          <div class="tab-content">
            <div class="tab-pane active DataList" id="home">
              <?php }?>
              
              <!-- 数据主体 -->
              <volist name="list" id="vo" key="i">
                <div class="col-md-6 col-sm-6">
                  <div class="panel">
                    <div class="panel-body panel-card">
                      <h4>{$vo.name}<span class="text-muted small"> - {:$positionList[$vo['position_id']]}/{:$groupList[$vo['group_id']]}</span></h4>
                      <div class="media"> <a class="pull-left" href="javascfipt:void());"> <img class="thumb media-object" width="100" src="<empty name="vo['img_url']">/Public/timg.jpg
                        <else/>
                        {$vo.img_url}
                        </empty>
                        " alt=""> </a>
                        <div class="media-body">
                          <address>
                          <strong>性别：
                          <eq name="vo['sex']" value="0">女
                            <else/>
                            男</eq>
                          </strong><br>
                          生日<br>
                          电话：{$vo.tel}<br>
                          </address>
                          <ul class="social-links">
                            <!--<li <if condition="$i eq 1"> data-position="bottom" data-intro="查看他的积分" </if> > <a title="" data-placement="top" data-toggle="tooltip" class="tooltips" target="_blank" href="javascript:void(0);" onClick="_openWindow('{:U('Analysis/chartlist',['member_member_id'=>$vo['id']])}',900,'个人动态','取消',null,'')"  data-original-title="他的积分"><i class="fa icon-smile-o"></i></a></li>-->
                            <!--<li><a title="" data-placement="top" data-toggle="tooltip" class="tooltips" href="" data-original-title="给他发信息"><i class="fa icon-comments-o"></i></a></li>-->
                            <li <if condition="$i eq 1"> data-position="bottom" data-intro="查看他的动态" </if> >
                              <!--增加权限控制2016-11-29 by：zmx-->
                              <if condition="getAccessMenu($accessList, 'Intesys', 'Info', 'index')"> <a title="" data-placement="top" data-toggle="tooltip" class="tooltips"  href="javascript:void(0);" onClick="_openWindow('{:U('Info/index',['member_id'=>$vo['id']])}',650,'个人动态','取消',null,'')"  data-original-title="他的动态"><i class="fa icon-hand-o-up"></i></a> </if>
                            </li>
                          </ul>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <!---->
                <!-- 数据主体结束 --> 
                
              </volist>
              <?php if(!IS_AJAX){?>
            </div>
          </div>
        </div>
      </section>
    </div>
    <div class="loading hidden">正在加载</div>
    <div class="PagesBox"><?php echo $pages;?></div>
  </div>
  <div class="col-sm-5 col-md-4 col-lg-3"> 
    <!--隐藏通讯录中添加功能2016-11-29 by：zmx--> 
    <!--
    <div class="states-info">
      <div class="panel green-bg">
        <div class="panel-body">
          <div class="row">
            <div class="col-xs-3"> <i class="fa icon-hand-o-right"></i> </div>
            <div class="col-xs-7">
              <h4>增加员工</h4>
              <span class="state-title"> 
              <if condition="getAccessMenu($accessList, 'Intesys', 'Member_contacts', 'add')"> <a class="text-success" href="##" onClick="_openWindow('<?php echo U('add');?>', 500, '增加员工', '保存', null, '');">点击这里增加员工</a> </if>
              </span> </div>
            <div class="col-xs-2"> <span class="fa icon-angle-right"></span> </div>
          </div>
        </div>
      </div>
    </div>
     -->
    <div class="affixelement">
        <div class="panel" >
            <header class="panel-heading"> 部门/职位 </header>
            <div class="panel-body">
                <form id="checkform" onSubmit="return searchform(document.getElementById('checkform'));">
                    <div class="input-group m-bot15">
                        <input type="text" name="keywords" class="form-control" placeholder="请输入关键词匹配搜索">
        <span class="input-group-btn">
        <button type="button" onClick="searchform(document.getElementById('checkform'));" class="btn btn-default"><i class="fa icon-search"></i></button>
        </span> </div>
                </form>
                <hr>
                <!--<div id="FlatTree" class="tree tree-plus-minus">-->
                <!--<div class = "tree-folder" style="display:none;">-->
                <!--<div class="tree-folder-header"> <i class="fa fa-folder"></i>-->
                <!--<div class="tree-folder-name"></div>-->
                <!--</div>-->
                <!--<div class="tree-folder-content"></div>-->
                <!--<div class="tree-loader" style="display:none"></div>-->
                <!--</div>-->
                <!--<div class="tree-item" style="display:none;"> <i class="tree-dot"></i>-->
                <!--<div class="tree-item-name"></div>-->
                <!--</div>-->
                <!--</div>-->
            </div>
        </div>
    <div class="panel" >
        <header class="panel-heading"> 按部门搜索</header>
        <div class="panel-body">
            <html:dropdownselect class="memberselect" listloaded="listloaded" selected="" name="member" style="height:auto; width:auto;" multi="0" action="{:U('Team/positionlist')}" title="选择员工" placeholder="点击选择部门" />
            <style>
                .selectlist{margin:0; padding:0;}
                .selectlist li{list-style-type:none; margin:0; padding:0;padding:5px; border-bottom:1px solid #eee; margin:0 8px;}
                .selectlist li:hover{background:#eee;}
            </style>
            <div id="reselectlayout" style="top:0; display:none; left:0; bottom:0; right:0; position:fixed; z-index:4999;"></div>
        </div>
    </div>
  </div>
</div>
    </div>
<include file="Public:script" />
<script src="__PUBLIC__/Js/highcharts.src.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/nanoscroller.min.js"></script> 
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/tether.min.js"></script> 
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/config.js"></script> 
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/util.js"></script> 
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/jquery.emojiarea.js"></script> 
<script src="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/js/emoji-picker.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/css/default.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/bootstrap/css/font-awesome.min.css">
<link href="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/css/nanoscroller.css" rel="stylesheet">
<link href="__PUBLIC__/Intesys/AdminX/js/EmojiPicker/lib/css/emoji.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Intesys/AdminX/js/fuelux/css/tree-style.css"/>
<script src="__PUBLIC__/Intesys/AdminX/js/fuelux/js/tree.min.js"></script> 
<script>

	function listloaded(){
        $('.memberselect').blur(function(){
//            $("#ajaxlistboxform input[name='member_position_id[]']").each(function(){
//                $(this).remove();
//            });
            $("#checkform input[name='member_position_id[]']").remove();
            $('.memberselect.binded .itemspan').each(function(){
                $('#checkform').append("<input type='hidden' name='member_position_id[]' value='"+$(this).children("input:eq(1)").attr('value')+"'>");
            });
           $('#checkform').submit();
        });
    }

var TreeView = function () {

    return {
        //main function to initiate the module
        init: function () {

            var DataSourceTree = function (options) {
                this._data  = options.data;
                this._delay = options.delay;
            };

            DataSourceTree.prototype = {

                data: function (options, callback) {
                    var self = this;
                    var data = $.extend(true, [], self._data);
					var parent_id = 0;
					if("type" in options && options.type == "folder") {
					   parent_id = options.additionalParameters['id'];	  　　　　
				  　}
				  //请求数据 
				  $.get('{:U('Member_position/tree')}', {pid:parent_id}, function(data1){
					  callback({ data: data1 });
					  //更新员工列表
					  $('#FlatTree .tree-item').unbind('click');
					$('#FlatTree .tree-item').each(function(index, element) {
						$(this).click(function(e) {
                            if(!$(this).hasClass('tree-selected')){
							$('#checkform').append('<input type="hidden" value="'+$(this).attr('itemid')+'" id="member_position_id'+$(this).attr('itemid')+'" name="member_position_id[]">');
							}else{
								$('#checkform').find('#member_position_id'+$(this).attr('itemid')).remove();
							}
							searchform(document.getElementById('checkform'));
                        });
                    });
				  },'json');
                }
            };
            // INITIALIZING TREE
            var treeDataSource = new DataSourceTree({
                data: [],
                delay: 0
            });
            $('#FlatTree').tree({
                dataSource: treeDataSource,
				selectable: 1,
				multiSelect: 1,
                loadingHTML: '<img src="__PUBLIC__/Intesys/AdminX/images/input-spinner.gif"/>',
            });
        }

    };

}();










    jQuery(document).ready(function() {
        TreeView.init();
    });


	
	
	
	
	
	
	
	
	

	
	
	
	
	

</script>
<style>
.states-info i.fa.fa-folder,.states-info i.fa.fa-folder-open,.states-info i.tree-dot{font-size:12px;}

</style>
</body></html><?php }?>